<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\user_center\behavior\user\fans_list_before;

/**
 * 检测隐私设置
 * @package app\user_center\behavior\user
 * @author shiqiang
 */
class checkPrivacy{
    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @return void
     */
    public function run($params){
		$user_id 			= $params['user_id'];
		$user_uid 			= $params['user_uid'];
		
		//检测被查看人 隐私设置
		$map = [];
		$map['uid'] = $user_uid;
		$Rel = model('UcMemberPrivacy', 'model\user') -> where($map) -> find();
		if(isset($Rel) && $Rel->fans_follow_auth != 0 && $user_id != $user_uid){
			return array_out(-1001, '用户进行了隐私设置 仅自己可看');
		}
    }
}
